let types = require('babel-types');
module.exports = function testPlugin() {
	return {
		name: "ast-transform", // not required
		visitor: {
			ExportDefaultDeclaration(path) {
				path.replaceWith(types.callExpression(types.identifier("Page"), [path.node.declaration]))
			},
			ObjectMethod(path) {
				if (path.node.key.name == "data") {
					console.log("---");
					path.replaceWith(
						types.ObjectProperty(types.identifier("data"), path.node.body.body[0].argument)
					);
				}
			},
			Identifier(path) {
				if (path.node.name == 'methods') {
					path.parentPath.replaceWithMultiple(path.container.value.properties)
				}
			}
		}
	};
}
